package com.yanze.schoolinformation.view.information;

import android.databinding.DataBindingUtil;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.yanze.schoolinformation.R;
import com.yanze.schoolinformation.base.BaseFragment;
import com.yanze.schoolinformation.databinding.FragmentInformationBinding;
import com.yanze.schoolinformation.view.information.book.BookListActivity;
import com.yanze.schoolinformation.view.information.gank.GankActivity;
import com.yanze.schoolinformation.view.information.movie.DoubanHotMovieActivity;
import com.yanze.schoolinformation.view.information.movie.DoubanMovieAtivity;
import com.yanze.schoolinformation.view.information.relax.RelaxActivity;

/**
 * Created by MrZheng on 2018/3/14.
 */

public class InformationFragment extends BaseFragment<FragmentInformationBinding> implements View.OnClickListener {

    @Override
    public int setContent() {
        return R.layout.fragment_information;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        showContentView();
        bindingView.setListener(this);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.douban_movie:
                DoubanHotMovieActivity.start(getContext());
                break;
            case R.id.douban_book:
                BookListActivity.start(getContext(), "心理学");
                break;
            case R.id.gank_gank:
                GankActivity.start(getActivity());
                break;
            case R.id.relax_fs:
                RelaxActivity.start(getActivity());
                break;
            default:
                break;
        }
    }
}
